---
layout: post
title: "Configure Sublime Text2 for JavaScript Development."
date: 2013-02-24
comments: false
categories:
 - sublime text
 - Linux
 - tips
 - windows
 - mac
---

<div class='post'>
<div dir="ltr" style="text-align: left;" trbidi="on">I recently started using Sublime Text2 full time at work after being a vim user for more than 4 years. Vim is really good but it takes sometime to configure it properly. Well this is not a Vim vs ST2 debate. It is more of a vim user shifting to ST2 Tip.<br /><br />The first thing that you should do is to install package control, it provide really good 3rd party plugins. You can check out the link how to install it.&nbsp;<a href="http://wbond.net/sublime_packages/package_control/installation" target="_blank">Install Package Control</a><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-VyTJ6GhccRQ/USn4XUWXanI/AAAAAAAABBU/JM261l4WaZw/s1600/Screen+Shot+2013-02-24+at+4.52.12+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-VyTJ6GhccRQ/USn4XUWXanI/AAAAAAAABBU/JM261l4WaZw/s400/Screen+Shot+2013-02-24+at+4.52.12+PM.png" width="400" /></a></div><br /><br />Once done with that open package manager and install these useful plugins<br /><br /><ul style="text-align: left;"><li>JSHint.</li><li>JSLint.</li><li>DocBlockr.</li><li>AngularJS.</li><li>Mocha &amp; Mocha snippet&nbsp;</li><li>NodeJS.</li><li>Live Reload.</li><li>AMD Module Editor</li><li>Backbone.js</li><li>Pretty JSON</li><li>Require Node.js Module Helper</li></ul><div><br /></div><div>Among, these plugins mocha is the test runner and mocha snippets provides you will snippets to write the tests very fast. Also, there is good plugin for vim mode in Sublime Text2, you can use that if you don't want to waste the muscle memory.&nbsp;I highly recommend the real time linting with JSHint. It will make you so much more&nbsp;productive and improve your code as well. It acts as the first unit test against the code you just wrote.&nbsp;</div><div><br /></div><div>One more important thing, you could set the indentation with tab width equals to 2 spaces. It is a very sane default while writing JavaScript code.</div><div><br /></div><div>What really struck me was that Sublime Text enabled me to do almost everything i did with Vim without going into the pain of configuration. Also, the learning curve is not at all steep so i could get productive real fast.</div></div></div>
<h2>Comments</h2>
<div class='comments'>
<div class='comment'>
<div class='author'>Joel</div>
<div class='content'>
Which mocha plugin are you referring to, the runner? or the snippet package? I&#39;m assuming you mean the runner, but I wasn&#39;t sure at first...and in the interest of clarity for others who may also have this question, perhaps you could clarify?  My experience with the rest of the plugins was smooth, however.</div>
</div>
<div class='comment'>
<div class='author'>Frank</div>
<div class='content'>
How do you debug javascript using the chrome debugger</div>
</div>
<div class='comment'>
<div class='author'>Unknown</div>
<div class='content'>
2013 Wishes: Sublime Text Terminal</div>
</div>
<div class='comment'>
<div class='author'>Unknown</div>
<div class='content'>
2013 Wishes: Sublime Text Terminal</div>
</div>
</div>
